package random.fox.p2p;

import flow.Layout;
import flow.path.Path;

/**
 * 记录一些路径
 * Created by wq on 15/3/13.
 */
public class Paths {


    public abstract static class MasterDetailPath extends Path {

        public abstract MasterDetailPath getMaster();

        public final boolean isMaster() {
            return equals(getMaster());
        }
    }

    public abstract static class ConversationPath extends MasterDetailPath {
        public final int index;

        protected ConversationPath(int index) {
            this.index = index;
        }

        @Override public MasterDetailPath getMaster() {
//            return null;
            return new SplashPath();
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            ConversationPath that = (ConversationPath) o;

            return index == that.index;
        }

        @Override
        public int hashCode() {
            return index;
        }
    }

    @Layout(R.layout.splash_view) //
    public static class SplashPath extends ConversationPath {
        public SplashPath() {
            super(-1);
        }
    }

    @Layout(R.layout.login_view)
    public static class LoginPath extends ConversationPath{
        public LoginPath() {
            super(1);
        }
    }

    @Layout(R.layout.register_view)
    public static class RegisterPath extends ConversationPath{
        public RegisterPath() {
            super(2);
        }
    }

    @Layout(R.layout.set_password_view)
    public static class SetPasswordPath extends ConversationPath{
        public SetPasswordPath(){
            super(3);
        }
    }

    @Layout(R.layout.set_info_view)
    public static class SetInfoPath extends ConversationPath{
        public SetInfoPath() {
            super(4);
        }
    }

    @Layout(R.layout.register_finish_view)
    public static class RegisterFinishPath extends ConversationPath{

        public RegisterFinishPath() {
            super(5);
        }
    }

    @Layout(R.layout.index_view)
    public static class IndexPath extends ConversationPath{
        public IndexPath(){
            super(-1);
        }
    }

    //构造时需要传递mid
    @Layout(R.layout.reply_view)
    public static class ReplyPath extends ConversationPath{
        public ReplyPath(int mid){
            super(mid);
        }
    }

    @Layout(R.layout.user_info_layout)
    public static class UserInfoPath extends ConversationPath{

        public UserInfoPath() {
            super(10);
        }
    }

    @Layout(R.layout.expand_personalitys_layout)
    public static class ExpandPersonalityPath extends ConversationPath{

        public ExpandPersonalityPath() {
            super(10);
        }
    }

    @Layout(R.layout.expand_dynamic_layout)
    public static class ExpandDynamicPath extends ConversationPath{

        public ExpandDynamicPath() {
            super(10);
        }
    }

    @Layout(R.layout.expand_fans_layout)
    public static class ExpandFansPath extends ConversationPath{
        public ExpandFansPath() {
            super(11);
        }

    }

    @Layout(R.layout.hot_view)
    public static class HotPath extends ConversationPath{
        public HotPath(){
            super(2);
        }
    }

    @Layout(R.layout.like_view)
    public static class LikePath extends ConversationPath{
        public LikePath(){
            super(3);
        }
    }

    @Layout(R.layout.fans_view)
    public static class FansPath extends ConversationPath{
        public FansPath(){
            super(4);
        }
    }

    @Layout(R.layout.attention_view)
    public static class AttentionViewPath extends ConversationPath{
        public AttentionViewPath(){
            super(5);
        }
    }

    @Layout(R.layout.send_message_view)
    public static class SendMessagePath extends ConversationPath{
        public SendMessagePath(){
            super(11);
        }
    }

    @Layout(R.layout.setting)
    public static class SettingPath extends ConversationPath{
        public SettingPath(){
            super(12);
        }
    }
}
